<template>
    <div id="main">
        <div class="sku-box store-content">
            <div class="sort-option">
                <ul class="line clear">
                    <li><a href="javascript:;" class="active">综合排序</a></li>
                    <li><a href="javascript:;" class="">销量排序</a></li>
                    <li><a href="javascript:;" class="">价格低到高</a></li>
                    <li><a href="javascript:;" class="">价格高到低</a></li>
                </ul>
            </div>
            <div class="gray-box">
                <div class="item-box">
                    <GoodItem 
                        v-for="(item,index) in goodlist" 
                        :key="index"
                        :gdata="item"
                    />
                </div>
            </div>
        </div>
        <el-button type="primary" round>按钮</el-button>
    </div>
</template>

<script>
    import GoodItem from '../components/GoodItem.vue'
    import {getGoodList} from '../api/goods.js'
    export default {
        components: {
            GoodItem,
        },
        data() {
            return {
                goodlist: []
            }
        },
        created () {
            getGoodList().then(res=>{
                this.goodlist = res.data
            })
        },
    }
</script>

<style lang="less" scoped>
@import url('../assets/css/goodsList.css');
</style>